GBML manual / Backgrounds

perspective_floor_behind

True when the point of the last perspective_floor_project call is behind the camera, false when it was ahead (too far to draw, or fine).

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet - The Sega Genesis will draw the road its own way.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

perspective_floor_behind() -> bool

Returns

bool

Description

True when the point of the last perspective_floor_project call is behind the camera, false when it was ahead (too far to draw, or fine). It tells the two reasons a point is not on the screen apart: behind the camera it is gone for now, ahead of it but past the horizon it is coming. It is false before any call.

Example

if (! perspective_floor_project(300, 640) && perspective_floor_behind()) {
    visible = false;
}

The pickup is hidden once the camera has passed it.

On the GBA

Use it to tell the two reasons a point is not on the screen apart: behind the camera it is gone for now; ahead of it but past the horizon it is coming.

See also: Perspective floorperspective_floor_projectperspective_floor_screen_x